package com.d2rv.model;

import com.d2rv.offscreen.OffScreen3D;
import com.d2rv.settings.Settings;
import java.io.File;
import processing.core.PApplet;
import processing.core.PVector;

/**
 * Manager of the city
 *
 * @author Darrieutort A., Dupouy A., Rossignol L., Van Poucke A.
 */
public class CityModelManager {

    private CityModel citymodel;

    /**
     * Default constructor.
     * @param parent The current application
     */
    public CityModelManager(PApplet parent) {
        Settings settings = Settings.getInstance();
        this.citymodel = new CityModel(parent, parent.dataPath("models" + File.separator + "city" + File.separator + settings.cityname()), new PVector(settings.cityposition().x, settings.cityposition().y, settings.cityposition().z), settings.cityscale());
    }

    /**
     * Triggers the draw instruction of the object parent
     * @param parent
     */
    public void drawCity(OffScreen3D parent) {
        this.citymodel.draw(parent);
    }

    /**
     * Returns the citymodel
     * @return the citymodel model
     */
    public CityModel citymodel() {
        return this.citymodel;
    }
}